package com.icygen.eclipsetools.ui.wizards;

import org.eclipse.core.resources.IProject;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;

import com.icygen.eclipsetools.project.config.ApplicationConfig;

public class ProjectConfigPage extends WizardPage {
	
	/*
	 * DB Settings Felds
	 */
	Text _host;
	Text _username;
	Text _password;
	Text _database;
	
	
	public ProjectConfigPage()
	{
		super("Project Config");
	    setTitle("Project Config");
	    setDescription("VS Tools Create Project Wizard Second Page.");
	}
	
	
	/* (non-Javadoc)
	 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
	 */
	@Override
	public void createControl(Composite parent) 
	{
		Composite container = new Composite(parent, SWT.NONE);
	    GridLayout gridLayout = new GridLayout(2, false);
	    container.setLayout(gridLayout);
	    
	    Label labelHost = new Label(container, SWT.LEFT);
	    labelHost.setText("Host: ");
	    _host = new Text(container, SWT.BORDER | SWT.SINGLE);
	    _host.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	    
	    
	    Label labelUsername = new Label(container, SWT.LEFT);
	    labelUsername.setText("Username: ");
	    _username = new Text(container, SWT.BORDER | SWT.SINGLE);
	    _username.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	    
	    
	    Label labelPassword = new Label(container, SWT.LEFT);
	    labelPassword.setText("Password: ");
	    _password = new Text(container, SWT.BORDER | SWT.SINGLE);
	    _password.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	    
	    
	    Label labelDatabase = new Label(container, SWT.LEFT);
	    labelDatabase.setText("Database: ");
	    _database = new Text(container, SWT.BORDER | SWT.SINGLE);
	    _database.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	    

	    // Required to avoid an error in the system
	    setControl(container);
	    setPageComplete(true);
	}
	
	public String getHost()
	{
		return _host.getText();
	}
	
	public String getUsername()
	{
		return _username.getText();
	}
	
	public String getPassword()
	{
		return _password.getText();
	}
	
	public String getDatabase()
	{
		return _database.getText();
	}
	
}
